package com.hsy.directseeding.common;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.hsy.directseeding.R;
import com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar;


/**
 * Created by MartinKent on 2016/8/21.
 */
public class LoadingProgressDialog extends Dialog {
    private View contentView;
    private CircleProgressBar progressBar;

    public LoadingProgressDialog(Context context) {
        super(context, R.style.loading_progress_dialog);
        init(context);
    }

    public LoadingProgressDialog(Context context, int themeResId) {
        super(context, R.style.loading_progress_dialog);
        init(context);
    }

    protected LoadingProgressDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, R.style.loading_progress_dialog);
        init(context);
    }

    private void init(Context context) {
        contentView = LayoutInflater.from(context).inflate(R.layout.my_progress_dialog, null);
        setContentView(contentView);
        progressBar = (CircleProgressBar) contentView.findViewById(R.id.progressWithoutBg);
        progressBar.setColorSchemeResources(android.R.color.holo_red_light);
        setCancelable(false);
        setCanceledOnTouchOutside(false);
    }
}
